package test01;

import java.util.Arrays;

/**
 * Enjoy programming!!!
 * Time: 2021/12/7 -  20:56
 */

    class Solution {
    public int[] sum(int[] nums, int target) {
        int n = nums.length;
        int[] a = new int[2];
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                if (nums[i] + nums[j] == target) {
                    a[0] = i;
                    a[1] = j;
                    return a;
                }
            }
        }
        return new int[]{0};
    }

    static class Main {
        public static void main(String[] args) {
            Solution solution = new Solution();
            System.out.println(Arrays.toString(solution.sum(new int[]{3, 5, 6}, 8)));

        }
    }
}
